1. Technical Field of the Invention
The present invention relates to a decoder for decoding a PWM (pulse width modulation) code and a communications system using the decoder.
2. Related Art
Conventionally, as an in-vehicle communications system, a communications system using a bus transmission line, such as CAN and LIN, is known (refer to, for example, a document 1 (M. Sato, “DETAILED DESCRIPTION OF VEHICLE NETWORK SYSTEM”, pp. 70-77, CQ Publishing Co., Ltd., Dec. 1, 2005)).
For communicating efficiently in this kind of communications system, it is desirable that behaviors of transceivers which are provided in nodes for sending and receiving signals via the transmission line are synchronized with each other.
As one of the methods for realizing such synchronization, it is suggested that one node in the communications system transmits on the transmission line signals coded with a line code including a clock component. In this method, the other nodes extract the clock component from the signals on the transmission line, generate a bus clock synchronized with the extracted clock component by processing (frequency dividing, etc.) a self-running clock generated in own nodes, and operate the transceiver according to the bus clock.
As one of the line codes including clock components, a PWM code using two PWM signals different in duty ratio is known. In the waveform of the PWM signals, the signal level changes at an end of a bit and within a bit. Hereinafter, the level change at the end of a bit is referred to a leading edge, and the level change within a bit is referred to a trailing edge. One of the leading and trailing edge is a falling edge, and the other is a rising edge.
As one of decoding method of the PWM code, a method for sampling the signal level after a predetermined interval of the timing of the leading edge is known. That is to say, the two kinds of the PWM signals, used in the PWM code, differ in timing of the trailing edge, therefore a period where the signal levels of the two PWM signals differ from each other occurs. In this decoding method, the sampling timing of the signal level is set within the period, and the two PWM signal are discriminated on the basis of the sampled signal level.